package com.hisoft.factory;

import com.hisoft.client.SearchClient;
import com.hisoft.fallback.SearchClientFallback;
import feign.hystrix.FallbackFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @program: springcloud2020
 * @description:
 * @author: wlg
 * @create: 2021-11-14 14:51:11
 **/
@Component
public class SearchClientFallbackFactory implements FallbackFactory<SearchClient> {
    @Autowired
    private SearchClientFallback searchClientFallback;
    @Override
    public SearchClient create(Throwable throwable) {
        throwable.printStackTrace();
        return searchClientFallback;
    }
}
